var $ = layui.$,layer = layui.layer;
$(document).on('keypress','#search_input',function(event){ 
	 if(event.keyCode == 13){
		 $(document).find("#searchBtn").trigger("click");
	 }
 });
var layer = layui.layer;

/*
 * 加载层
 * 用法 var a = showShade();
 * 关闭  layer.close(a);
 * 
 */
function showShade(){
	return layer.load(0,{shade: [0.2,'#000']});
}

//var param = {
//		目录1:1,
//		目录2:2,
//}
//showNavBar(param);

/*
 * 参数格式
 * name : href;
 */
function showNavBar(param){
	
	var html = "";
	for(var i in param){
		html+='<li><a href="#'+param[i]+'" class="layui-this"><cite>'+i+'</cite></a></li>';
	}
	html="<ul class='site-dir layui-layer-wrap'>"+html+"</ul>"
	var navBar = layer.open({
		  type: 1
		  ,title: '目录'
		  ,offset: 'r'
		  ,shade: 0
		  ,area: '180px'
		  ,content: html
		  ,success: function(layero, index){
	        layer.style(index, {
	          marginLeft: -20
	        });
	      }
	}); 
	$("#layui-layer"+navBar).css("left")
	
	
}
